package com.situ.fly.dao;



import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.situ.fly.entity.Answer;

@Mapper
public interface AnswerDao {

	/**
	 * 
	 * 添加
	 */
	@Insert("insert into answer (content,qid,uid)"
	+"values(#{content},#{qid},#{uid})")
	int insert(Answer answer);
	
	
	/**
	 * 根据问题id，获取回复信息
	 * 
	 * 
	 */
	@Select("select answer.*,user.nickname "
			+"from answer, user where answer.uid=user.id and qid=#{qid}" )
	
	List<Map<String,Object>> selectByQid(Integer qid);
	
	
	
}
